$(function () {
    //======================
    //======设置查询条件========
    //======================
    //内部公司
    $("#wlycwkc_toolbar [name='gsId']").gsjgtree(1);


//======================
//========统计列表========
//======================
    var columns = [
        [
            {field: 'gsname', title: '园区', rowspan: 2, width: 100, align: 'center'},
            {field: 'wzbm', title: '物资编码', rowspan: 2, width: 100, align: 'right'},
            {field: 'pm', title: '品名', rowspan: 2, width: 100, align: 'right'},
            {field: 'cz', title: '材质', rowspan: 2, width: 100, align: 'right'},
            {field: 'ggxh', title: '规格型号', rowspan: 2, width: 100, align: 'right'},
            {field: 'kcje', title: '库存金额', rowspan: 2, width: 100, align: 'right', formatter: function (v, r, i) {
                return formatJe2(v, ",", ".");
            }},
            {field: 'kcsl', title: '库存数量', rowspan: 2, width: 100, align: 'right', formatter: function (v, r, i) {
                return formatSl2(v, ",", ".");
            }}
        ]
    ];

    var grid = $('#wlycwkc_grid').datagrid({
        url: $.webPath() + '/report/wlycwkc/wlycwkcList',
        toolbar: "#wlycwkc_toolbar",
        pagination: true,
        rownumbers: true,
        singleSelect: true,
        collapsible: true,
        fit: true,
        fitColumns: true,
        pageNumber: 1,
        showFooter: true,
        queryParams: {
            cwkcRq:$("#cwkc_rq").val()
        },
        onLoadSuccess: function () {
        },
        columns: columns
    });


//搜索按钮
    $("#wlycwkc_toolbar [name='searchButton']").click(function () {
        $(grid).datagrid({
            queryParams: {
                gsId: $("#wlycwkc_toolbar [name='gsId']").val(),
                khMc: $("#wlycwkc_toolbar [name='khMc']").val(),
                wzbm: $("#wlycwkc_toolbar [name='wzbm']").val(),
                pm: $("#wlycwkc_toolbar [name='pm']").val(),
                cz: $("#wlycwkc_toolbar [name='cz']").val(),
                ggxh: $("#wlycwkc_toolbar [name='ggxh']").val(),
                cwkcRq:$("#cwkc_rq").val()
            }});
    });


});


